import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86186
 * Date: 2023-09-21
 * Time: 12:13
 */
public class Demo1 {
    public static void main(String[] args) {
        ExecutorService service = Executors.newFixedThreadPool(4);
        service.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程1");
            }
        });

        service.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程2");
            }
        });

        service.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程3");
            }
        });

        service.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程3");
            }
        });
    }
}
